package com.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.model.Alipay;

import com.service.AlipayServiceI;


@Controller
@RequestMapping("/alipayController")
public class AlipayController {
	
	private AlipayServiceI alipayService;

	public AlipayServiceI getAlipayService() {
		return alipayService;
	}
	
	@Autowired
	public void setAlipayService(AlipayServiceI alipayService) {
		this.alipayService = alipayService;
	}



	@ResponseBody
	@RequestMapping("/showAlipay")
	public String showAlipay(String alipayid,HttpServletRequest request){
		
		Alipay alipay=alipayService.getAlipayByAlipayid(Integer.valueOf(alipayid));
		return JSON.toJSONString(alipay);
	}
}
